package cn.xuyang520.tyim.sys.core;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2017/4/2.
 */
@Component("tyCache")
@CacheConfig(cacheNames = "tyCache")
public class TyCache {

    @CachePut(key = "#p0")
    public Object set(String key, Object value) {
        return value;
    }

    @Cacheable(key = "#p0")
    public Object get(String key) {
        return null;
    }

    @CacheEvict(key = "#p0")
    public void delete(String key) {
    }

    @CachePut(key = "#p0 + ':' +  #p1")
    public Object set(String type, String key, Object value) {
        return value;
    }

    @Cacheable(key = "#p0 + ':' +  #p1")
    public Object get(String type, String key) {
        return null;
    }

    @CacheEvict(key = "#p0 + ':' +  #p1")
    public void delete(String type, String key) {
    }

}
